FROM ubuntu:15.04

RUN echo "deb http://archive.ubuntu.com/ubuntu/ vivid multiverse" >> /etc/apt/sources.list
RUN echo "deb-src http://archive.ubuntu.com/ubuntu/ vivid multiverse" >> /etc/apt/sources.list
RUN echo "deb http://archive.ubuntu.com/ubuntu/ vivid-updates multiverse" >> /etc/apt/sources.list
RUN echo "deb-src http://archive.ubuntu.com/ubuntu/ vivid-updates multiverse" >> /etc/apt/sources.list

RUN apt-get update

# 0.12.1 - Static Patched Version
#COPY wkhtmltox-0.12.2.1_linux-trusty-amd64.deb /tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
#RUN dpkg --force-depends -i /tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb 

# 0.13 - Alpha Version
#COPY wkhtmltox-0.13.0-alpha-7b36694_linux-trusty-amd64.deb /tmp/wkhtmltox-0.13.0-alpha-7b36694_linux-trusty-amd64.deb
#RUN dpkg --force-depends -i /tmp/wkhtmltox-0.13.0-alpha-7b36694_linux-trusty-amd64.deb
#RUN apt-get install -f -y
#RUN apt-get install -y xvfb

# Ubuntu Distributed Version
RUN apt-get install -y wkhtmltopdf xvfb openssl libssl-dev

#
# Fonts Installation
# https://help.ubuntu.com/community/Fonts#Chinese.2C_Japanese.2C_and_Korean_Fonts
#
RUN apt-get install -y ttf-wqy-microhei
RUN apt-get install -y fonts-thai-tlwg
RUN echo yes | apt-get install -y msttcorefonts

COPY pdfservice /

CMD [ "/pdfservice" ]
EXPOSE 8080
